# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ifchk
pkgver=1.1.3
pkgrel=1
groups=('blackarch' 'blackarch-defensive' 'blackarch-networking')
pkgdesc='A network interface promiscuous mode detection tool.'
arch=('x86_64' 'aarch64')
url='http://www.noorg.org/ifchk/'
license=('GPL2')
depends=('sysfsutils')
source=("https://www.noorg.org/ifchk/dist/$pkgname-$pkgver.tar.gz")
sha512sums=('e3cf1808db94af452661c7ca78b300b099e638ce1c1e9667d3bd419849cdf707a4f8c97c1aa4c4b9ea0b592d65dfb7137aeae3096695635c8f1b68e67e38b265')

build() {
  cd "$pkgname-$pkgver"

  make
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 "$pkgname.conf" "$pkgdir/usr/share/$pkgname/ifchk.conf"
  install -Dm 644 "docs/$pkgname.1" "$pkgdir/usr/share/man/man1/ifchk.1"
  install -Dm 644 "docs/$pkgname.conf.5" \
    "$pkgdir/usr/share/man/man5/ifchk.conf.5"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" CHANGES MANIFEST \
    README_FIRST papers/*
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

